var e = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../../../@babel/runtime/regenerator")), t = require("../../../@babel/runtime/helpers/asyncToGenerator"), a = getApp();

Page({
    data: {
        page: 1,
        total_page: 1,
        list: [],
        order_number: ""
    },
    onSearch: function(e) {
        this.setData({
            order_number: e.detail
        }), this.getData({
            order_sn: e.detail,
            page: 1
        });
    },
    link: function(e) {
        var t = e.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageI/checkout-equipment/detail/detail?id=" + t
        });
    },
    onLoad: function() {
        this.getData();
    },
    getData: function() {
        var n = arguments, r = this;
        return t(e.default.mark(function t() {
            var i;
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    i = n.length > 0 && void 0 !== n[0] ? n[0] : {}, a._getNetWork({
                        url: a.getNetAddresss("plugin.health-check.frontend.index.index"),
                        data: i,
                        success: function(e) {
                            var t = e.data, n = t.result, i = t.msg, o = t.data, u = o.data, s = o.current_page, d = o.last_page;
                            if (0 == n) return a.tips(i);
                            r.setData({
                                page: s,
                                total_page: d
                            }), 1 == s ? r.setData({
                                list: u || []
                            }) : r.setData({
                                list: r.data.list.concat(u)
                            });
                        }
                    });

                  case 2:
                  case "end":
                    return e.stop();
                }
            }, t);
        }))();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.page >= this.data.total_page)) {
            var e = {
                page: this.data.page + 1
            };
            this.data.order_number && (e.order_number = this.data.order_number), this.getData(e);
        }
    },
    onShareAppMessage: function() {}
});